home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ASME's Mechanical Engine…ing Toolkit 1997 December
/
ASME's Mechanical Engineering Toolkit 1997 December.iso
/
auto_cad
/
sizer.lsp
< prev
next >
Wrap
Text File
|
1988-07-16
|
1KB
|
47 lines
; Program Sizer.lsp Version 1.0
; By Jim MCMillan. 86.July.31
; Program automatically resizes a drawing to fit given area.
;
;
(DEFUN C:SIZER ()
(makeblock)
(resize)
(getblock)
(COMMAND "ZOOM" "A")
)
(defun makeblock ()
(setq ur (getvar "EXTMAX" ))
; Get the most upper right point drawing uses.
(setvar "CMDECHO" 0)
(setvar "HIGHLIGHT" 0)
(command "BLOCK" "PLOT" "0,0" "W" "0,0" ur "" )
; Makes a block of the drawing, and calls it PLOT.
)
(defun resize ()
(setq top-right (getvar "LIMMAX"))
(setq lm1 (car top-right))
; Assign first atom of Limmax to lm1.
(setq lm2 (cadr top-right))
; Assign last atom of Limmax to lm1.
(setq pt1 (getreal "Enter new length value for x >> "))
(setq pt2 (getreal "Enter new length value for y >> "))
(setq xscale (/ pt1 lm1))
; Calculate new x scale factor.
(setq yscale (/ pt2 lm2 ))
; Calculate new y scale factor.
(setq pt3 (list pt1 pt2))
; Put the two reals into a list.
(setvar "CMDECHO" 0)
(command "LIMITS" "" pt3 )
)
(defun Getblock ()
(setvar "CMDECHO" 0)
(COMMAND "INSERT" "PLOT" "0,0" xscale yscale "" )
)
;Program complete.